home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
-
- #include <vcl.h>
- #include <stdio.h>
- #include <io.h>
- #include <dir.h>
- #pragma hdrstop
-
- #include "Unit1.h"
- #include "Unit2.h"
- #include <stdlib.h>
- #include <shellapi.hpp>
- #include <windows.h>
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm2 *Form2;
- //---------------------------------------------------------------------------
- __fastcall TForm2::TForm2(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm2::Button1Click(TObject *Sender)
- {
- CreateDir("C:\\mobilis_temp");
- Image1->Picture->SaveToFile ("C:\\mobilis_temp\\pic.jpg");
- TJPEGImage *jpg = new TJPEGImage();
- Graphics::TBitmap* bmp = new Graphics::TBitmap();
- try
- {
- jpg->LoadFromFile("C:\\mobilis_temp\\pic.jpg");
- bmp->Assign(jpg);
- //--------------------------------------------------------------
- bmp->SaveToFile("C:\\mobilis_temp\\pic.bmp");
- }
- __finally
- {
- delete jpg;
- delete bmp;
- }
-
- SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\\mobilis_temp\\pic.bmp", SPIF_UPDATEINIFILE);
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm2::Button2Click(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm2::Image1Click(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
-
-